***********************************************
*
* "Public Works and Intimate Partner Violence"
* Replication Master Do File
*
***********************************************/


	clear all
	set maxvar 10000

	
* Define globals for directories

	gl dir 							"[YOUR DIRECTORY]"

	
* Define globals for DVs and covariates

	gl ipv								pers_viol_dum_harm pers_pysch_dum_harm pers_econ_dum_harm   
	gl ipv_full_disagg					pers_viol_dum_harm feelbad_last_yr humiliate_last_yr scare_last_yr threatyou_last_yr threat_oth_last_yr take_earn_harm nojob_last_yr nohouse_last_yr
	gl autonomy							fin_own
	gl econ								iga days_worked any_income iga_wage30_win save save_amt_win 
	gl psych							depressed unimportant exploitation fam_accept_dum
	gl equalrights						equalrights_dum
	gl married							married
	gl divorced							divorced
	gl econ_fam							spouse_income hhiga hhany_income hhiga_wage30_win // Egypt only
	gl project 							have_proj_infra have_proj_any_enviroment have_proj_educ have_proj_health // Egypt only
	gl econ_sector						iga_construction iga_farming iga_state // Tunisia only
	gl indices 							pers_idx_harm_std econ_idx_std psych_wellbeing_vsimp_std
	
	gl controls 						age born born_gov
	gl controls_endline_2 				age
	gl controls_Egypt_only 				mother_no_educ father_no_educ hhmother_no_educ hhfather_no_educ // Egypt only
	gl controls_Egypt_only_endline_2 	mother_no_educ father_no_educ // Egypt only
	gl controls_Tunisia_only 			iga_2013 iga_wage30_2013_win iga_2014 iga_wage30_2014_win // Tunisia only

	
	
* Change directory

	capture	cd "$dir"

	
* Replicate Table 2

	gl outcomes			ipv
		do "Analysis/tables_endline_1_merged.do"
	

* Replicate Table 3

	gl outcomes			autonomy
		do "Analysis/tables_endline_1_merged.do"
	

* Replicate Table 4

	gl outcomes			econ
		do "Analysis/tables_endline_1_merged.do"

		
* Replicate Table 5

	gl outcomes			psych
		do "Analysis/tables_endline_1_merged.do"

		
* Replicate Table 6

	gl outcomes			ipv
		do "Analysis/tables_endline_1_merged_ge.do"
	
	
* Replicate Table 7

	gl outcomes			ipv
		do "Analysis/tables_endline_2_merged.do"

		
* Replicate Table SI.2
	
	gl summstats_merged				pers_viol_dum_harm pers_viol_dum_harm pers_pysch_dum_harm pers_econ_dum_harm $autonomy $econ $psych equalrights_dum divorce married any_child age born born_gov   
	
	gl summstats_Egypt_only			$summstats_merged mother_no_educ father_no_educ hhmother_no_educ hhfather_no_educ
	
	gl summstats_Tunisia_only		$summstats_merged iga_2013 iga_wage30_2013_win iga_2014 iga_wage30_2014_win
		do "Analysis/tables_endline_1_merged_summstats.do"

		
* Replicate Table SI.3
	
	gl summstats_merged				pers_viol_dum_harm pers_viol_dum_harm pers_pysch_dum_harm pers_econ_dum_harm $autonomy $econ $psych equalrights_dum divorce married any_child age born born_gov   
	
	gl summstats_Egypt_only			$summstats_merged mother_no_educ father_no_educ hhmother_no_educ hhfather_no_educ
	
	gl summstats_Tunisia_only		$summstats_merged iga_2013 iga_wage30_2013_win iga_2014 iga_wage30_2014_win
		do "Analysis/tables_endline_1_merged_summstats_ge.do"

						
* Replicate Table SI.4
	
	use "Data/endline_1_egypt_lead.dta", clear

	areg treatvil mhh_num mprop_women mprop_youth mprop_adults mprop_45older mnilecanals mreclaimland mdesert mmountains mbadevents_1 mbadevents_3 mbadevents_4 mbadevents_5 if num==1, absorb(matchid)
		local F_stat = round(e(F),.001)	

	eststo balance_egypt: areg treatvil mhh_num mprop_women mprop_youth mprop_adults mprop_45older mnilecanals mreclaimland mdesert mmountains mbadevents_1 mbadevents_3 mbadevents_4 mbadevents_5 if num==1, absorb(matchid)

		estadd local strata "Yes"
		estadd local F_stat "`F_stat'"		
		
		esttab balance_egypt using "Output/balance_lead_egypt.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br ///
			mgroups("\shortstack{\textbf{Treatment} \\ \textbf{village}}", pattern(1 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			nomtitles drop(_cons) ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes scalars("F_stat F-stat" "strata Strata FE") 
	
	

* Replicate Table SI.5

	use "Data/census_tunisia.dta", clear

	regress beneficiaire num_hh hh_size male_18over fem_18over unemploy_rate illit_rate prop_prim_educ access_services Strata2 Strata3
		local F_stat = round(e(F),.001)	
		
	eststo balance_census_tunisia: regress beneficiaire num_hh hh_size male_18over fem_18over unemploy_rate illit_rate prop_prim_educ access_services Strata2 Strata3
		estadd local strata "Yes"
		estadd local F_stat "`F_stat'"		
		
		esttab balance_census_tunisia using "Output/balance_census_tunisia.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br ///
			mgroups("\shortstack{\textbf{Treatment} \\ \textbf{imada}}", pattern(1 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			nomtitles drop(Strata2 Strata3 _cons) ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes scalars("F_stat F-stat" "strata Strata FE") 
					


* Replicate Table SI.6

	use "Data/endline_1_egypt_fem.dta", clear
		
	reghdfe within $controls $controls_Egypt_only, cluster(vil) absorb(matchid)
		local F_stat_within = round(e(F),.001)	
	
	reghdfe between $controls $controls_Egypt_only, cluster(vil) absorb(matchid)
		local F_stat_between = round(e(F),.001)	
		
	reghdfe spillovers $controls $controls_Egypt_only, cluster(vil) absorb(matchid)
		local F_stat_spillovers = round(e(F),.001)	
	
	eststo balance_within_egypt: reghdfe within $controls $controls_Egypt_only, cluster(vil) absorb(matchid)
		estadd local strata "Yes"
		estadd local F_stat "`F_stat_within'"		
	
	eststo balance_between_egypt: reghdfe between $controls $controls_Egypt_only, cluster(vil) absorb(matchid)
		estadd local strata "Yes"
		estadd local F_stat "`F_stat_between'"		
	
	eststo balance_spill_egypt: reghdfe spillovers $controls $controls_Egypt_only, cluster(vil) absorb(matchid)
		estadd local strata "Yes"
		estadd local F_stat "`F_stat_spillovers'"		
		
		esttab balance_between_egypt balance_within_egypt balance_spill_egypt using "Output/balance_endline_1_egypt.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br ///
			mgroups("\textbf{Between}" "\textbf{Within}" "\textbf{Spillover}", pattern(1 1 1) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			nomtitles keep($controls $controls_Egypt_only) ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes scalars("F_stat F-stat" "strata Strata FE") 

			
			
* Replicate Table SI.7

	use "Data/endline_1_tunisia_fem.dta", clear
	
	regress within $controls $controls_Tunisia_only i.Strata, vce(cluster imada)
		local F_stat_within = round(e(F),.001)	
	
	regress between $controls $controls_Tunisia_only i.Strata, vce(cluster imada)
		local F_stat_between = round(e(F),.001)	
	
	regress spillovers $controls $controls_Tunisia_only i.Strata, vce(cluster imada)
		local F_stat_spillovers = round(e(F),.001)	
	
	eststo balance_within_tunisia: regress within $controls $controls_Tunisia_only i.Strata, vce(cluster imada)
		estadd local strata "Yes"
		estadd local F_stat "`F_stat_within'"		
	
	eststo balance_between_tunisia: regress between $controls $controls_Tunisia_only i.Strata, vce(cluster imada)
		estadd local strata "Yes"
		estadd local F_stat "`F_stat_between'"		
	
	eststo balance_spill_tunisia: regress spillovers $controls $controls_Tunisia_only i.Strata, vce(cluster imada)
		estadd local strata "Yes"
		estadd local F_stat "`F_stat_spillovers'"		
		
		esttab balance_between_tunisia balance_within_tunisia balance_spill_tunisia using "Output/balance_endline_1_tunisia.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br ///
			mgroups("\textbf{Between}" "\textbf{Within}" "\textbf{Spillover}", pattern(1 1 1) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			nomtitles keep($controls $controls_Tunisia_only) ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes scalars("F_stat F-stat" "strata Strata FE") 
	
			
* Replicate Table SI.8

	use "Data/endline_1_tunisia_fem.dta",  clear

	leebounds pers_viol_dum_harm within
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_pysch_dum_harm within
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_econ_dum_harm within
		local obs = e(N)
		local obs_sel = e(Nsel)
		
	eststo leebounds_within_phys: leebounds pers_viol_dum_harm within
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_psych: leebounds pers_pysch_dum_harm within
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_econ: leebounds pers_econ_dum_harm within
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	
	esttab leebounds_within_phys leebounds_within_psych leebounds_within_econ  ///
		using "Output/leebounds_endline_1_tunisia.tex", replace ///
			booktabs b(3) se(3) eqlabels(none) br ///
			mgroups("\shortstack{\textbf{Experienced} \\ \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \\ \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \\ \textbf{economic} \\ \textbf{coercion}}" , pattern(1 1 1) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			nomtitles ///
			coeflabel(upper "Upper bound" lower "Lower bound") ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes scalars("Nobs Observations" "Nobs_sel Selected observations") 

	
	
* Replicate Table SI.9

	use "Data/endline_2_egypt_fem.dta", clear

	leebounds pers_viol_dum_harm between, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_viol_dum_harm within, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_viol_dum_harm spillovers, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	
	leebounds pers_pysch_dum_harm between, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_pysch_dum_harm within, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_pysch_dum_harm spillovers, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)

	leebounds pers_econ_dum_harm between, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_econ_dum_harm within, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_econ_dum_harm spillovers, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
				
	eststo leebounds_between_phys: leebounds pers_viol_dum_harm between, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_phys: leebounds pers_viol_dum_harm within, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_spill_phys: leebounds pers_viol_dum_harm spillovers, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	
	eststo leebounds_between_psych: leebounds pers_pysch_dum_harm between, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_psych: leebounds pers_pysch_dum_harm within, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_spill_psych: leebounds pers_pysch_dum_harm spillovers, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"

	eststo leebounds_between_econ: leebounds pers_econ_dum_harm between, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_econ: leebounds pers_econ_dum_harm within, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_spill_econ: leebounds pers_econ_dum_harm spillovers, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"

	esttab leebounds_between_phys leebounds_within_phys leebounds_spill_phys ///
			leebounds_between_psych leebounds_within_psych leebounds_spill_psych ///
			leebounds_between_econ leebounds_within_econ leebounds_spill_econ ///
				using "Output/leebounds_endline_2_egypt.tex", replace ///
					booktabs b(3) se(3) eqlabels(none) br ///
					mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}" , pattern(1 0 0 1 0 0 1 0 0 ) ///
					prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
					mtitle("Between" "Within" "Spillovers" "Between" "Within" "Spillovers" "Between" "Within" "Spillovers" ) ///
					coeflabel(upper "Upper bound" lower "Lower bound") ///
					star(* 0.10 ** 0.05 *** 0.01) nonotes scalars("Nobs Observations" "Nobs_sel Selected observations")
				


* Replicate Table SI.10

	use "Data/endline_2_tunisia_fem.dta", clear

	leebounds pers_viol_dum_harm between, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_viol_dum_harm within, select(non_attriter_within)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_viol_dum_harm spillovers, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	
	leebounds pers_pysch_dum_harm between, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_pysch_dum_harm within, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_pysch_dum_harm spillovers, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)

	leebounds pers_econ_dum_harm between, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_econ_dum_harm within, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
	leebounds pers_econ_dum_harm spillovers, select(non_attriter)
		local obs = e(N)
		local obs_sel = e(Nsel)
				
	eststo leebounds_between_phys: leebounds pers_viol_dum_harm between, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_phys: leebounds pers_viol_dum_harm within, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_spill_phys: leebounds pers_viol_dum_harm spillovers, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	
	eststo leebounds_between_psych: leebounds pers_pysch_dum_harm between, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_psych: leebounds pers_pysch_dum_harm within, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_spill_psych: leebounds pers_pysch_dum_harm spillovers, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"

	eststo leebounds_between_econ: leebounds pers_econ_dum_harm between, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_within_econ: leebounds pers_econ_dum_harm within, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"
	eststo leebounds_spill_econ: leebounds pers_econ_dum_harm spillovers, select(non_attriter)
		estadd local Nobs "`obs'"
		estadd local Nobs_sel "`obs_sel'"

	esttab leebounds_between_phys leebounds_within_phys leebounds_spill_phys ///
			leebounds_between_psych leebounds_within_psych leebounds_spill_psych ///
			leebounds_between_econ leebounds_within_econ leebounds_spill_econ ///
				using "Output/leebounds_endline_2_tunisia.tex", replace ///
					booktabs b(3) se(3) eqlabels(none) br ///
					mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}" , pattern(1 0 0 1 0 0 1 0 0 ) ///
					prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
					mtitle("Between" "Within" "Spillovers" "Between" "Within" "Spillovers" "Between" "Within" "Spillovers") ///
					coeflabel(upper "Upper bound" lower "Lower bound") ///
					star(* 0.10 ** 0.05 *** 0.01) nonotes scalars("Nobs Observations" "Nobs_sel Selected observations") 

					
			
* Replicate Table SI.11

	gl outcomes			ipv_full_disagg
		do "Analysis/tables_endline_1_merged.do"
	
	
	
* Replicate Table SI.12

	gl outcomes			ipv
	gl threshold		dist_all_25pct
		do "Analysis/tables_endline_1_egypt_buffer.do"


		
* Replicate Table SI.13
	
	gl outcomes			indices
		do "Analysis/tables_endline_1_merged.do"

		
		
* Replicate Table SI.14
		
	gl outcomes			ipv	
		do "Analysis/tables_endline_1_merged_multi.do"
		
		
		
* Replicate Table SI.15
		
	gl outcomes			econ	
		do "Analysis/tables_endline_1_merged_multi.do"
		
		
		
* Replicate Table SI.16
		
	gl outcomes			psych	
		do "Analysis/tables_endline_1_merged_multi.do"
		
		
		
* Replicate Table SI.17

	gl outcomes			ipv	
		do "Analysis/tables_endline_1_merged_multi_ge.do"

		
* Replicate Table SI.18

	gl outcomes			ipv	
		do "Analysis/tables_endline_2_merged_multi.do"
		

* Replicate Table SI.19

	gl outcomes			equalrights
		do "Analysis/tables_endline_1_merged.do"

		
		
* Replicate Table SI.20

	gl outcomes			equalrights
		do "Analysis/tables_endline_1_merged_mf.do"

	
	
* Replicate Table SI.21

	gl outcomes			divorced
		do "Analysis/tables_endline_1_merged.do"

		
			
* Replicate Table SI.22
		
	gl outcomes			econ_fam
		do "Analysis/tables_endline_1_egypt.do"
		

		
* Replicate Table SI.23

	gl outcomes			econ	
		do "Analysis/tables_endline_1_merged_ge.do"
		
		
		
* Replicate Table SI.24
		
	gl outcomes			project
		do "Analysis/tables_endline_1_egypt.do"
		

		
* Replicate Table SI.25

	gl outcomes			project
		do "Analysis/tables_endline_1_egypt_ge.do"
	
	
	
* Replicate Table SI.26

	gl outcomes			econ_sector
		do "Analysis/tables_endline_1_Tunisia_m.do"
	
	
	
* Replicate Table SI.27

	use "Data/endline_1_egypt_fem.dta", clear

		foreach x of varlist between within spillovers {
			gen `x'_age = `x'*age
		}
		
		la var between "Between"
		la var within "Within"
		la var spillovers "Spillovers"
		
		la var between_age "Between $\times$ age"
		la var within_age "Within $\times$ age"
		la var spillovers_age "Spillovers $\times$ age"

	* Physical violence
	
		eststo between_phys_hte: reghdfe pers_viol_dum_harm between age between_age, cluster(vil) absorb(matchid)
		eststo within_phys_hte: reghdfe pers_viol_dum_harm within age within_age, cluster(vil) absorb(matchid)
		eststo spill_phys_hte: reghdfe pers_viol_dum_harm spillovers age spillovers_age, cluster(vil) absorb(matchid)

	* Psychological abuse

		eststo between_psych_hte: reghdfe pers_pysch_dum_harm between age between_age, cluster(vil) absorb(matchid)
		eststo within_psych_hte: reghdfe pers_pysch_dum_harm within age within_age, cluster(vil) absorb(matchid)
		eststo spill_psych_hte: reghdfe pers_pysch_dum_harm spillovers age spillovers_age, cluster(vil) absorb(matchid)
		
	* Economic coercion
	
		eststo between_econ_hte: reghdfe pers_econ_dum_harm between age between_age, cluster(vil) absorb(matchid)
		eststo within_econ_hte: reghdfe pers_econ_dum_harm within age within_age, cluster(vil) absorb(matchid)
		eststo spill_econ_hte: reghdfe pers_econ_dum_harm spillovers age spillovers_age, cluster(vil) absorb(matchid)
		
		esttab between_phys_hte within_phys_hte spill_phys_hte ///
			between_psych_hte within_psych_hte spill_psych_hte ///
			between_econ_hte within_econ_hte spill_econ_hte ///
			using "Output/endline_1_egypt_ipv_hte_age.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br nocons ///
			mtitle("Between" "Within" "Spillover" "Between" "Within" "Spillover" "Between" "Within" "Spillover") mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}", pattern(1 0 0 1 0 0 1 0 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes 
	
	
	
* Replicate Table SI.28

	use "Data/endline_1_tunisia_fem.dta", clear

		foreach x of varlist between within spillovers {
			gen `x'_age = `x'*age
		}
		
		la var between "Between"
		la var within "Within"
		la var spillovers "Spillovers"
		
		la var between_age "Between $\times$ age"
		la var within_age "Within $\times$ age"
		la var spillovers_age "Spillovers $\times$ age"

	* Physical violence

		eststo between_phys_hte: areg pers_viol_dum_harm between age between_age, ab(Strata) vce(cluster imada)
		eststo within_phys_hte: areg pers_viol_dum_harm within age within_age, ab(Strata) vce(cluster imada)
		eststo spill_phys_hte: areg pers_viol_dum_harm spillovers age spillovers_age, ab(Strata) vce(cluster imada)
		
	* Psychological abuse

		eststo between_psych_hte: areg pers_pysch_dum_harm between age between_age, ab(Strata) vce(cluster imada)
		eststo within_psych_hte: areg pers_pysch_dum_harm within age within_age, ab(Strata) vce(cluster imada)
		eststo spill_psych_hte: areg pers_pysch_dum_harm spillovers age spillovers_age, ab(Strata) vce(cluster imada)

	* Economic coercion

		eststo between_econ_hte: areg pers_econ_dum_harm between age between_age, ab(Strata) vce(cluster imada)
		eststo within_econ_hte: areg pers_econ_dum_harm within age within_age, ab(Strata) vce(cluster imada)
		eststo spill_econ_hte: areg pers_econ_dum_harm spillovers age spillovers_age, ab(Strata) vce(cluster imada)
		
		esttab between_phys_hte within_phys_hte spill_phys_hte ///
			between_psych_hte within_psych_hte spill_psych_hte ///
			between_econ_hte within_econ_hte spill_econ_hte ///
			using "Output/endline_1_tunisia_ipv_hte_age.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br  ///
			mtitle("Between" "Within" "Spillover" "Between" "Within" "Spillover" "Between" "Within" "Spillover") mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}", pattern(1 0 0 1 0 0 1 0 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) nocons ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes 
		
		
		
		
			
* Replicate Table SI.29
	
	use "Data/endline_1_egypt_fem.dta", clear

		foreach x of varlist between within spillovers {
			gen `x'_any_child = `x'*any_child
			gen `x'_num_child = `x'*num_child
		}
		
		la var between "Between"
		la var within "Within"
		la var spillovers "Spillovers"
		
		la var between_any_child "Between $\times$ has children"
		la var within_any_child "Within $\times$ has children"
		la var spillovers_any_child "Spillovers $\times$ has children"
		
		la var between_num_child "Between $\times$ \# children"
		la var within_num_child "Within $\times$ \# children"
		la var spillovers_num_child "Spillovers $\times$ \# children"
		
	* Physical violence
	
		eststo between_phys_hte: reghdfe pers_viol_dum_harm between any_child between_any_child, cluster(vil) absorb(matchid)
		eststo within_phys_hte: reghdfe pers_viol_dum_harm within any_child within_any_child, cluster(vil) absorb(matchid)
		eststo spill_phys_hte: reghdfe pers_viol_dum_harm spillovers any_child spillovers_any_child, cluster(vil) absorb(matchid)

	* Psychological abuse

		eststo between_psych_hte: reghdfe pers_pysch_dum_harm between any_child between_any_child, cluster(vil) absorb(matchid)
		eststo within_psych_hte: reghdfe pers_pysch_dum_harm within any_child within_any_child, cluster(vil) absorb(matchid)
		eststo spill_psych_hte: reghdfe pers_pysch_dum_harm spillovers any_child spillovers_any_child, cluster(vil) absorb(matchid)
		
	* Economic coercion
	
		eststo between_econ_hte: reghdfe pers_econ_dum_harm between any_child between_any_child, cluster(vil) absorb(matchid)
		eststo within_econ_hte: reghdfe pers_econ_dum_harm within any_child within_any_child, cluster(vil) absorb(matchid)
		eststo spill_econ_hte: reghdfe pers_econ_dum_harm spillovers any_child spillovers_any_child, cluster(vil) absorb(matchid)
		
		esttab between_phys_hte within_phys_hte spill_phys_hte ///
			between_psych_hte within_psych_hte spill_psych_hte ///
			between_econ_hte within_econ_hte spill_econ_hte ///
			using "Output/endline_1_egypt_ipv_hte_any_child.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br nocons ///
			mtitle("Between" "Within" "Spillover" "Between" "Within" "Spillover" "Between" "Within" "Spillover") mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}", pattern(1 0 0 1 0 0 1 0 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes 
		
				
				
* Replicate Table SI.30

	use "Data/endline_1_tunisia_fem.dta", clear
						
		foreach x of varlist between within spillovers {
			gen `x'_any_child = `x'*any_child
			gen `x'_num_child = `x'*num_child
		}
		
		la var between "Between"
		la var within "Within"
		la var spillovers "Spillovers"
		
		la var between_any_child "Between $\times$ has children"
		la var within_any_child "Within $\times$ has children"
		la var spillovers_any_child "Spillovers $\times$ has children"

		la var between_num_child "Between $\times$ \# children"
		la var within_num_child "Within $\times$ \# children"
		la var spillovers_num_child "Spillovers $\times$ \# children"
		
	* Physical violence

		eststo between_phys_hte: areg pers_viol_dum_harm between any_child between_any_child, ab(Strata) vce(cluster imada)
		eststo within_phys_hte: areg pers_viol_dum_harm within any_child within_any_child, ab(Strata) vce(cluster imada)
		eststo spill_phys_hte: areg pers_viol_dum_harm spillovers any_child spillovers_any_child, ab(Strata) vce(cluster imada)
		
	* Psychological abuse

		eststo between_psych_hte: areg pers_pysch_dum_harm between any_child between_any_child, ab(Strata) vce(cluster imada)
		eststo within_psych_hte: areg pers_pysch_dum_harm within any_child within_any_child, ab(Strata) vce(cluster imada)
		eststo spill_psych_hte: areg pers_pysch_dum_harm spillovers any_child spillovers_any_child, ab(Strata) vce(cluster imada)

	* Economic coercion

		eststo between_econ_hte: areg pers_econ_dum_harm between any_child between_any_child, ab(Strata) vce(cluster imada)
		eststo within_econ_hte: areg pers_econ_dum_harm within any_child within_any_child, ab(Strata) vce(cluster imada)
		eststo spill_econ_hte: areg pers_econ_dum_harm spillovers any_child spillovers_any_child, ab(Strata) vce(cluster imada)
		
		esttab between_phys_hte within_phys_hte spill_phys_hte ///
			between_psych_hte within_psych_hte spill_psych_hte ///
			between_econ_hte within_econ_hte spill_econ_hte ///
			using "Output/endline_1_tunisia_ipv_hte_any_child.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br  ///
			mtitle("Between" "Within" "Spillover" "Between" "Within" "Spillover" "Between" "Within" "Spillover") mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}", pattern(1 0 0 1 0 0 1 0 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) nocons ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes 
		
	
	
* Replicate Table SI.31

	use "Data/endline_1_egypt_fem.dta", clear
		
		foreach x of varlist between within spillovers {
			gen `x'_married = `x'*married
		}
		
		la var between "Between"
		la var within "Within"
		la var spillovers "Spillovers"
		
		la var between_married "Between $\times$ married"
		la var within_married "Within $\times$ married"
		la var spillovers_married "Spillovers $\times$ married"
		
	* Physical violence
	
		eststo between_phys_hte: reghdfe pers_viol_dum_harm between married between_married, cluster(vil) absorb(matchid)
		eststo within_phys_hte: reghdfe pers_viol_dum_harm within married within_married, cluster(vil) absorb(matchid)
		eststo spill_phys_hte: reghdfe pers_viol_dum_harm spillovers married spillovers_married, cluster(vil) absorb(matchid)

	* Psychological abuse

		eststo between_psych_hte: reghdfe pers_pysch_dum_harm between married between_married, cluster(vil) absorb(matchid)
		eststo within_psych_hte: reghdfe pers_pysch_dum_harm within married within_married, cluster(vil) absorb(matchid)
		eststo spill_psych_hte: reghdfe pers_pysch_dum_harm spillovers married spillovers_married, cluster(vil) absorb(matchid)
		
	* Economic coercion
	
		eststo between_econ_hte: reghdfe pers_econ_dum_harm between married between_married, cluster(vil) absorb(matchid)
		eststo within_econ_hte: reghdfe pers_econ_dum_harm within married within_married, cluster(vil) absorb(matchid)
		eststo spill_econ_hte: reghdfe pers_econ_dum_harm spillovers married spillovers_married, cluster(vil) absorb(matchid)
		
		esttab between_phys_hte within_phys_hte spill_phys_hte ///
			between_psych_hte within_psych_hte spill_psych_hte ///
			between_econ_hte within_econ_hte spill_econ_hte ///
			using "Output/endline_1_egypt_ipv_hte_married.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br nocons ///
			mtitle("Between" "Within" "Spillover" "Between" "Within" "Spillover" "Between" "Within" "Spillover") mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}", pattern(1 0 0 1 0 0 1 0 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes 
		

		
* Replicate Table SI.32

	use "Data/endline_1_tunisia_fem.dta", clear

		foreach x of varlist between within spillovers {
			gen `x'_married = `x'*married
		}
		
		la var between "Between"
		la var within "Within"
		la var spillovers "Spillovers"
		
		la var between_married "Between $\times$ has children"
		la var within_married "Within $\times$ has children"
		la var spillovers_married "Spillovers $\times$ has children"
		
	* Physical violence

		eststo between_phys_hte: areg pers_viol_dum_harm between married between_married, ab(Strata) vce(cluster imada)
		eststo within_phys_hte: areg pers_viol_dum_harm within married within_married, ab(Strata) vce(cluster imada)
		eststo spill_phys_hte: areg pers_viol_dum_harm spillovers married spillovers_married, ab(Strata) vce(cluster imada)
		
	* Psychological abuse

		eststo between_psych_hte: areg pers_pysch_dum_harm between married between_married, ab(Strata) vce(cluster imada)
		eststo within_psych_hte: areg pers_pysch_dum_harm within married within_married, ab(Strata) vce(cluster imada)
		eststo spill_psych_hte: areg pers_pysch_dum_harm spillovers married spillovers_married, ab(Strata) vce(cluster imada)

	* Economic coercion

		eststo between_econ_hte: areg pers_econ_dum_harm between married between_married, ab(Strata) vce(cluster imada)
		eststo within_econ_hte: areg pers_econ_dum_harm within married within_married, ab(Strata) vce(cluster imada)
		eststo spill_econ_hte: areg pers_econ_dum_harm spillovers married spillovers_married, ab(Strata) vce(cluster imada)
		
		esttab between_phys_hte within_phys_hte spill_phys_hte ///
			between_psych_hte within_psych_hte spill_psych_hte ///
			between_econ_hte within_econ_hte spill_econ_hte ///
			using "Output/endline_1_tunisia_ipv_hte_married.tex", replace ///
			label booktabs b(3) se(3) eqlabels(none) br  ///
			mtitle("Between" "Within" "Spillover" "Between" "Within" "Spillover" "Between" "Within" "Spillover") mgroups("\shortstack{\textbf{Experienced} \textbf{physical} \\ \textbf{violence}}" "\shortstack{\textbf{Experienced} \textbf{pyschological} \\ \textbf{abuse}}" "\shortstack{\textbf{Experienced} \textbf{economic} \\ \textbf{coercion}}", pattern(1 0 0 1 0 0 1 0 0) ///
			prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) nocons ///
			star(* 0.10 ** 0.05 *** 0.01) nonotes 
		
		
* Replicate Table SI.33
	
	gl outcomes			ipv	
		do "Analysis/tables_endline_1_merged_ctrls.do"
		


* Replicate Table SI.34
	
	gl outcomes			autonomy	
		do "Analysis/tables_endline_1_merged_ctrls.do"

		
		
* Replicate Table SI.35
	
	gl outcomes			econ	
		do "Analysis/tables_endline_1_merged_ctrls.do"
		
		
		
* Replicate Table SI.36
	
	gl outcomes			equalrights	
		do "Analysis/tables_endline_1_merged_ctrls.do"
			
			

* Replicate Table SI.37
	
	gl outcomes			equalrights	
		do "Analysis/tables_endline_1_merged_mf_ctrls.do"
			
			
		
* Replicate Table SI.38
	
	gl outcomes			divorced	
		do "Analysis/tables_endline_1_merged_ctrls.do"
		
		
	
* Replicate Table SI.39
	
	gl outcomes			psych	
		do "Analysis/tables_endline_1_merged_ctrls.do"
		
		
		
* Replicate Table SI.40
	
	gl outcomes			ipv	
		do "Analysis/tables_endline_1_merged_ctrls_ge.do"
		
		
* Replicate Table SI.41
	
	gl outcomes			ipv	
		do "Analysis/tables_endline_2_merged_ctrls.do"
		
		
		
* Replicate Table SI.42

	gl outcomes			autonomy
		do "Analysis/tables_endline_2_merged.do"
		
		
		
* Replicate Table SI.43

	gl outcomes			econ
		do "Analysis/tables_endline_2_merged.do"
		
		
		
* Replicate Table SI.44

	gl outcomes			divorced
		do "Analysis/tables_endline_2_merged.do"
		
		
		
		
